package com.action.music;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.beans.music.MusicType;
import com.business.music.MusicTypeBus;
import com.config.SystemGlobals;

public class AddMuiscType extends HttpServlet {

	private static final long serialVersionUID = 1L;
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		String contentType = SystemGlobals.getValue("contentType");
		PrintWriter out = response.getWriter();
		response.setContentType(contentType);
		String musictypeName = request.getParameter("musictypename");
		String musictypeMemo = request.getParameter("musictypememo");
		String username = request.getParameter("username");
		MusicType mt = new MusicType();
		mt.setMusictypeMemo(musictypeMemo);
		mt.setMusictypeName(musictypeName);
		mt.setUsername(username);
		MusicTypeBus mtb = new MusicTypeBus();
		mtb.add(mt);
		out
				.print("<script>alert(\"添加相册成功\");window.location=\"user/addmusic.jsp\";</script>");
		out.close();
	}

}
